<template>
  <div class="page header-left">
    <base-header :leftIcon="null" title="投资动态"></base-header>

    <div class="p-20">
      <base-title>2023年6月</base-title>

      <!-- 表格 -->
      <div v-for="(t, tIndex) in tableJsons" :key="tIndex">
        <base-title :inline="true" v-if="t.title">{{ t.title }}</base-title>
        <base-table
          class="mb-20"
          :columns="t.columns"
          :datas="t.datas"
          @td-click="onTdClick"
        ></base-table>
      </div>

      <!-- 图表 -->
      <div class="mb-20" v-for="(t, tIndex) in chartJsons" :key="tIndex">
        <base-title :inline="t.inline" v-if="t.title">
          {{ t.title }}
        </base-title>
        <base-chart :style="t.style" :options="t.options"></base-chart>
      </div>
    </div>

    <div class="footer bd-top"></div>
  </div>
</template>

<script>
import tableJsons from "./tableJsons";
import chartJsons from "./chartJsons";

export default {
  data() {
    return {
      tableJsons,
      chartJsons,
    };
  },

  onLoad() {},

  methods: {
    onTdClick(d, v, i) {
      if (i === 0) {
        uni.navigateTo({
          url: `/pages/news/detail?title=${v.value}`,
        });
      }
    },
  },
};
</script>

<style lang="scss" scoped></style>
